package com.sina.shop.service.address;

import com.sina.shop.core.BaseService;
import com.sina.shop.core.exception.client.DataException;
import com.sina.shop.core.exception.server.CreateException;
import com.sina.shop.core.exception.server.ResourceExistsException;
import com.sina.shop.core.exception.server.UpdateException;
import com.sina.shop.domain.address.Address;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * 段浩杰   2018-02-06-9:24
 */
public interface AddressService extends BaseService {

    //根据用户id得到所拥有的地址列表
    List<Address> getAddressListByAdminId(Long adminId);

    //根据id删除地址
    Integer deleteAddress(Long id) throws DataException, UpdateException;

    //保存地址
    Address saveAddress(Address address) throws CreateException, ResourceExistsException, DataException;

    //更新地址
    Address updateAddress(Address address) throws UpdateException, DataException;

    //更新地址状态为可用
    int updateAddressStatusUse(Long id) throws UpdateException;

    //更新地址状态为不可用
    int updateAddressStatusNot(Long aid) throws UpdateException;
}
